---
title: Submit Appworx batch job (shared overload)
summary: Convenience one-call wrapper that optionally redirects to a fixed non-production Appworx database, then constructs and submits an Appworx job request.
status: draft
owner: <owner>
last_reviewed: 2026-08-21
library: SAIF.Services.Appworx
reference_type: package
operation_id: OP-APX-003
trigger: Caller invokes the shared (static) clsRequestAppworxJob.SubmitBatchJob(...) overload
---

# Submit Appworx batch job (shared overload)

This operation is the convenience entry point used by all observed callers (`SAIF.Application.Claim.Legal\LegalNet\`): it optionally overrides the Oracle target for non-production environments, then constructs a `clsRequestAppworxJob`, populates its arguments, and submits the job in a single call.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-APX-003 |
| **Trigger** | Caller invokes the shared `SubmitBatchJob(inDPI, inModule, [inRequestor], [inPrinter], [inArg1..inArg20], [inUseWCISDEV1AppworxForAllDevEnv])` overload. |
| **Inputs** | `inDPI`, `inModule`, optional `inRequestor`/`inPrinter`, optional `inArg1`–`inArg20`, optional `inUseWCISDEV1AppworxForAllDevEnv` (default `False`) |
| **Outputs** | Delegates to the instance `SubmitBatchJob()` operation; no direct return value |
| **Primary components** | `clsRequestAppworxJob.SubmitBatchJob` (shared/static overload) |
| **Entry point** | `SAIF.Services.Appworx\clsRequestAppworxJob.vb` |

## Steps

1. Evaluate `inUseWCISDEV1AppworxForAllDevEnv` (default `False`) ([BR-APX-003](../business-rules.md#br-apx-003-non-production-appworx-target-override)).
   - If `True`: call `AppGlobal.EnvironmentService.GetApplicationEnvironment()` to decide between `WCISPROD` (Prod) and `WCISDEV1` (all non-Prod environments), construct a new `clsMSOracleDataLayer("PRADT", target)`, and derive a fresh `IDataPortalInfo` from it.

     > **Origin**: The environment lookup (`AppGlobal.EnvironmentService.GetApplicationEnvironment()`) and Oracle data-layer/connection construction (`clsMSOracleDataLayer`) are implemented in the referenced `SAIF.BOF.Framework` / `SAIF.BOF.Framework.Security.EnvironmentApi` packages; their internal logic was not traced from local source and no local operations page documents it**.
   - If `False` (default, used by all observed callers): use the caller-supplied `inDPI` directly.
2. Construct a `clsRequestAppworxJob` with the resolved DPI, which internally calls `InitArgs()` (see [Reset job arguments](reset-job-arguments.md)).
3. Set `ModuleName`, `Requestor`, `Printer` from the supplied parameters.
4. For each of `inArg1`–`inArg20`, if the parameter `IsNot Nothing`, assign it to the corresponding instance property ([BR-APX-004](../business-rules.md#br-apx-004-unspecified-arguments-left-unset-in-shared-overload)).
   - If a parameter is `Nothing`: the corresponding instance property retains its empty default from `InitArgs()` and is never sent to the stored procedure ([BR-APX-001](../business-rules.md#br-apx-001-optional-arguments-omitted-when-empty)).
5. Call the instance `SubmitBatchJob()` ([SQL-APPWORX-001](../sql/SQL-APPWORX-001-submit-appworx-job.md)), which performs the stored-procedure submission and error wrapping.

   > **Origin**: Steps performed by the instance method are detailed in [Submit Appworx batch job (instance)](submit-appworx-batch-job.md) — invoked here as the final delegation step.

## Process flow

```mermaid
flowchart TD
	Start([Shared SubmitBatchJob invoked]) --> D{inUseWCISDEV1AppworxForAllDevEnv = True?}
	D -->|Yes, Prod env| Prod[clsMSOracleDataLayer PRADT/WCISPROD]
	D -->|Yes, non-Prod env| Dev[clsMSOracleDataLayer PRADT/WCISDEV1]
	D -->|No| CallerDPI[Use caller-supplied IDataPortalInfo]
	Prod --> Construct[New clsRequestAppworxJob and InitArgs]
	Dev --> Construct
	CallerDPI --> Construct
	Construct --> SetProps[Set ModuleName, Requestor, Printer, Arg1..Arg20 where supplied]
	SetProps --> Delegate[Call instance SubmitBatchJob]
	Delegate --> EndOk([Job submitted, or ApplicationException on failure])
```

## Failure and edge-case behavior

- All failure behavior is inherited from the delegated instance `SubmitBatchJob()` call ([BR-APX-002](../business-rules.md#br-apx-002-submission-failures-are-wrapped-and-rethrown)).
- An `inArgN` parameter passed as `Nothing` is indistinguishable at the stored-procedure boundary from an argument the caller never intended to set — both result in the parameter being omitted.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)

## Sources
- `SAIF.Services.Appworx\clsRequestAppworxJob.vb`
